package mao.exaimnation.zhongxin;

import java.util.Scanner;

//中兴笔试，求区间最大值，直接贪心，找最大的值即可。
public class Main1 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int n = scanner.nextInt();
            int max = 0;
            int tmp = 0;
            for (int i = 0; i < n; i++) {
                tmp = scanner.nextInt();
                if (tmp > max){
                    max = tmp;
                }
            }
            System.out.println(max);
        }
    }

}
